package com.lintpanzer.managers{
	import com.lintpanzer.views.LpAlert;
	import com.lintpanzer.views.OptionsPanel;
	
	import flash.display.DisplayObject;
	import flash.events.IEventDispatcher;
	
	import mx.core.IFlexDisplayObject;
	import mx.managers.PopUpManager;
	
	public class LpPopUpManager extends ManagerBase{
		public function LpPopUpManager(target:IEventDispatcher=null){
			super(target);
		}
		
		public function openLpAlert(parent:DisplayObject,title:String,message:String,modal:Boolean=true):void{
			var lpAlert:LpAlert = new LpAlert();
				lpAlert.title = title;
				lpAlert.message = message;
			PopUpManager.addPopUp(lpAlert,parent,modal);
			PopUpManager.centerPopUp(lpAlert);
		}
		
		public function closePopUp(popUp:IFlexDisplayObject):void{
			PopUpManager.removePopUp(popUp);
		}
		
		public function openOptions(parent:DisplayObject):void{
			var options:OptionsPanel = new OptionsPanel();
			PopUpManager.addPopUp(options,parent,true);
			PopUpManager.centerPopUp(options);
		}
	}
}